{% extends "header.html" %}
{% block content %}
<script>
function delUser(){
	if(confirm("删除"))
	{
 		$("#ops").val("delete");
		$("#adminform").submit();
	}
}
function addUser(){
	$("#op").val("add");
	$("#adminform").submit();
}
function check_submit(op){
	$("#op").val(op+"_submit");
	$("#editadmin").submit();
	return true;
}
function cancel(){
	$("#op").val("");
	$("#editadmin").submit();
	return true;
}
</script>
<br />
<div>
<form action="admincp.php?mod=admin&act=list" method="post" id="editadmin" name="editadmin">
<table cellspacing="2" cellpadding="0">
	<tr>
		<td width="120" align="right" style="padding:10px 0;">用户名</td>
		<td><input name='username' id="username" type="text" value="" size="20" /></td>
	</tr>
	<!--{if $op == "add"}-->
	<tr>
		<td align="right" style="padding:10px 0;">密 码</td>
		<td><input  name="password" id="password" type="text"  size="20" /></td>
	</tr>
	<!--{/if}-->
	<tr>
		<td align="right" style="padding:10px 0;">语言</td>
		<td><select name="language" class="text" >
			<option value ="zh_CN">中文</option>
			</select>
		</td>
	</tr>
	<tr>
		<td align="right" style="padding:10px 0;">管理组</td>
		<td><select name="admingroup" class="text" >
            {% for groupid, onegroup in allGroupPermission.items %}
            <option value="{{groupid}}" >{{onegroup.name}}</option>
            {% endfor %}
			</select>
            当前组默认权限<input type="checkbox" name="resetAuth" value="resetAuth"/>
		</td>
	</tr>
	<tr>
		<td align="right" valign="top" style="padding:10px 0;">用户权限</td>
		<td>
		<table cellspacing="0" cellpadding="0">
		{% for k, mod in request.session.menu.items %}
            {% if mod.sub_menu %}
                <tr>
                    <td > <input type="checkbox" name="auth[]" value="{{mod.permit}}"  />{{mod.name}} </td>
                    <td>ssss<tr><td >{{mod.name}}</td></tr>
                        <!--{% for act in mod.sub_menu %}-->
                            <!--<tr><td >{{act.name}}</td></tr>-->
                        <!--{% endfor %}-->
                    </td>
                </tr>
            {% endif %}
        {% endfor %}
		</table>
		</td>
	</tr>

	<tr>
		<td>
		<input type="hidden" name="adminuid"  value='{$admin_user[uid]}'>
		<input type="hidden" name="op" id="op" value="{$op}">
		</td>
		<td>
		<input type="button" value="{$MALANG['btn_submit']}" name="btn_submit" onclick="check_submit('{$op}');" />&nbsp;&nbsp;
		<input type="button" value="{$MALANG['btn_cancel']}" name="btn_cancel" onclick="cancel();" />
		</td>
	</tr>
</table>
</form>
<!--{/if}-->

</div>
{% endblock %}